package pt.ipleiria.estg.dei.ei.es2.bio;

import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.Menu;
import android.view.MenuItem;

/**
 * Created by Ricardo on 12/03/2015.
 */
public class SettingsActivity extends PreferenceActivity {
    public static final int RESULT_OK = 1;

    @Override
    protected void onCreate(Bundle savedInstaceState){
        super.onCreate(savedInstaceState);
        addPreferencesFromResource(R.xml.settingspreferences);
    }


    public boolean onCreateOptionMenu(Menu menu){
        getMenuInflater().inflate(R.menu.menu_settings,menu);
        return true;
    }


    public boolean onOptionItemSelected(MenuItem item){
        int id = item.getItemId();

        if(id== R.id.action_settings){
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onBackPressed(){
        setResult(RESULT_OK);
        super.onBackPressed();
    }

}
